<#assign nojs=true>
<#include "/WEB-INF/default/fragment/header.ftl">
<body>

<script type="text/javascript" src="${request.contextPath}/assets/js/jquery.js"></script>
<script src="//cdn.bootcss.com/moment.js/2.10.6/moment.min.js"></script>
<script type="text/javascript" src="${request.contextPath}/assets/js/bootstrap.min.js"></script>

<#include "/WEB-INF/default/fragment/nav.ftl">

<link href="//cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker-standalone.min.css" rel="stylesheet">
<link href="//cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<script src="//cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>

<style>
.legend {
  border-bottom: 1px solid red;
  padding: 0px;
}
fieldset {
  width: 80%;
  margin: 0 auto;
}
</style>
<div class="container">
  <div class="tms-logo"><img class="center-block" src="${request.contextPath}/assets/images/logo.png" alt=""></div>
</div>

<div class="container">
<form class="form-horizontal" action="${request.contextPath}/team-post.action?team.id=<#if team?? && team.id??>${team.id}</#if>" method="post">
<#-- 
  <input type="hidden" class="form-control" name="team.id" value="<#if team?? && team.id??>${team.id}</#if>">
 -->
  <legend class="clearfix">
    <div class="pull-left"><h4>${title!"增加新团队"}</h4></div>
    <div class="pull-right">
      <a href="${request.contextPath}/team-list.action" class="btn btn-default">我的团队</a>
      <a href="${request.contextPath}/team-post.action" class="btn btn-default">新增团队</a>
      <button type="submit" class="btn btn-success">保存</button>
    </div>
  </legend>
  <fieldset>

    <div class="form-group">
      <label class="col-sm-2 control-label">团队名称</label>
      <div class="col-sm-10">
        <input type="text" class="form-control" name="team.name" value="<#if team?exists && team.name?exists>${team.name}</#if>">
        <p class="help-block">团队的名称，如 java1605</p>
        <#if fieldErrors?exists && fieldErrors['team.name']?exists>
        <p class="help-block"><span class="text-danger">${fieldErrors['team.name']}</span></p>
        </#if>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label">团队描述</label>
      <div class="col-sm-10">
        <input type="text" class="form-control" name="team.desc" value="<#if team?exists && team.desc?exists>${team.desc}</#if>">
        <p class="help-block">团队的描述，如 java 专业第1605实训部</p>
        <#if fieldErrors?exists && fieldErrors['team.desc']?exists>
        <p class="help-block"><span class="text-danger">${fieldErrors['team.desc']}</span></p>
        </#if>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label">个性域名</label>
      <div class="col-sm-10">
        <input type="text" class="form-control" name="team.subdomain" value="<#if team?exists && team.subdomain?exists>${team.subdomain}</#if>" <#if team?? && team.id??>readonly</#if>>
        <p class="help-block">可以使用个性域名访问该团队地址。默认为/team-{个性域名}.action ， 创建之后不能修改。</p>
        <#if fieldErrors?exists && fieldErrors['team.subdomain']?exists>
        <p class="help-block"><span class="text-danger">${fieldErrors['team.subdomain']}</span></p>
        </#if>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label">开始日期</label>
      <div class="col-sm-10">
        <input type="text" class="form-control" placeholder="yyyy-MM-dd" name="team.startDate" id="startDate" value="<#if team?exists && team.startDate?exists>${team.startDate?date}</#if>">
        <p class="help-block">开始实训的日期。</p>
        <#if fieldErrors?exists && fieldErrors['team.startDate']?exists>
        <p class="help-block"><span class="text-danger">${fieldErrors['team.startDate']}</span></p>
        </#if>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label">预计结束日期</label>
      <div class="col-sm-10">
        <input type="text" class="form-control" placeholder="yyyy-MM-dd" name="team.endDate" id="endDate" value="<#if team?exists && team.endDate?exists>${team.endDate?date}</#if>">
        <p class="help-block">一般是开始日期之后的 4~6 个月的时间值。</p>
        <#if fieldErrors?exists && fieldErrors['team.endDate']?exists>
        <p class="help-block"><span class="text-danger">${fieldErrors['team.endDate']}</span></p>
        </#if>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label">团队状态</label>
      <div class="col-sm-10">
        <div>
          <div><label><input type="radio" name="team.status" value="1" <#if team?exists && team.status?? && team.status == 1>checked</#if>>尚未开始</label></div>
          <div><label><input type="radio" name="team.status" value="2" <#if team?exists && team.status?? && team.status == 2>checked</#if>>正在实训中</label></div>
          <div><label><input type="radio" name="team.status" value="3" <#if team?exists && team.status?? && team.status == 3>checked</#if>>毕业项目实战</label></div>
          <div><label><input type="radio" name="team.status" value="4" <#if team?exists && team.status?? && team.status == 4>checked</#if>>完成实训</label></div>
          <div><label><input type="radio" name="team.status" value="5" <#if team?exists && team.status?? && team.status == 5>checked</#if>>结束团队</label></div>
        </div>
        <p class="help-block">状态值只能从上往下顺序设置，不能倒序操作。如：已进入“毕业项目实战”阶段的团队不能再次回到“正在实训中”状态。</p>
        <#if fieldErrors?exists && fieldErrors['team.status']?exists>
        <p class="help-block"><span class="text-danger">${fieldErrors['team.status']}</span></p>
        </#if>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label">团队主页</label>
      <div class="col-sm-10">
        <input type="text" class="form-control">
        <p class="help-block">富文本介绍，可以制作个性化的团队页面。</p>
      </div>
    </div>
    <script>
    (function(config) {
      $('#startDate').datetimepicker(config);
      $('#endDate').datetimepicker(config);
    })({
      format: 'YYYY-MM-DD', 
      icons: {
        time: "fa fa-clock-o",
        date: "fa fa-calendar",
        up: "fa fa-arrow-up",
        down: "fa fa-arrow-down"
      }
    });
    </script>
    
  </fieldset>
</form>
</div>

</body>
<#include "/WEB-INF/default/fragment/footer.ftl">
